cfg={_id:"{{mongodb_replSetName}}", members:[
{% for ip in groups.mongodb %} 
    {_id:{{loop.index0}},host:"{{ip}}:{{mongodb_port}}",priority:{{loop.revindex}}},
{% endfor %}
        ]
    }

rs.initiate(cfg);

